import 'dart:math';

import 'package:flutter/material.dart';
import 'package:wallpaper/components/z_video/zsn_class.dart';

class ZsnBar extends StatelessWidget {
  final double currentVolume;
  final double height;
  final bool isVolume; // 默认音量图标
  const ZsnBar({
    super.key,
    required this.currentVolume,
    required this.height,
    this.isVolume = true,
  });
  @override
  Widget build(BuildContext context) {
    return Positioned(
      right: 0,
      top: (height - 30) / 2,
      height: 30,
      width: 100,
      child: Transform.rotate(
        angle: -pi / 2,
        child: Row(
          children: [
            Transform.rotate(
              angle: pi / 2,
              child: isVolume
                  ? ZsnClass().volumeIcon(currentVolume)
                  : ZsnClass().brightnessIcon(currentVolume),
            ),
            SizedBox(
              width: 3,
              height: 3,
            ),
            Expanded(
              child: LinearProgressIndicator(
                backgroundColor: Colors.grey[200],
                valueColor: AlwaysStoppedAnimation(Colors.blue),
                value: currentVolume,
              ),
            )
          ],
        ),
      ),
    );
  }
}
